Skip to content

Stop slow peers from blocking healthy traffic - #172

Merged
myobie merged 1 commit into
mainfrom
fix/peer-lock-head-of-line
Sep 5, 2026
Merged

Stop slow peers from blocking healthy traffic#172
myobie merged 1 commit into
mainfrom
fix/peer-lock-head-of-line

Conversation

@myobie

@myobie myobie commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

The peer health loop holds one global connection-map mutex while it dials an unreachable peer. Every other peer waits for that machine.

A retained 358.498-second window measured 300 direct hetz-to-Silber probes. All passed, but 19 exceeded two seconds.

Eighteen slow probes aligned with the 20-second health loop. External p50 was 45.013 ms, p95 was 2.117 seconds, and p99 was 2.675 seconds.

The synchronized internal window recorded 18 Silber probes below 200 ms. It recorded no loss or retry, so that instrument misses the lock wait.

Change

Use one connection mutation gate per peer. Release the global map before the network dial and generation exchange.

The same-peer gate preserves connection replacement and simultaneous-open ordering. A slow peer no longer holds the map used by healthy peers.

The health loop remains sequential. That can delay later health samples, but it cannot delay application traffic after this change.

Proof

The new deterministic test pauses one peer during generation exchange. It then opens a stream through an existing connection to another peer.

The test failed on current main in 0.73 seconds. It passed after the change.

  • cargo test mux::tests -- --nocapture: 14 passed and one measurement ignored.
  • cargo test --lib: 514 passed and five measurements ignored.
  • The simultaneous-peer integration test passed.

The retained production files remain on hetz under /tmp/fabric-latency-1788586961-*. The telemetry blindness needs a separate fix.

@myobie
myobie force-pushed the fix/peer-lock-head-of-line branch from 2d88e4a to dcbf4bf Compare September 5, 2026 06:03
@myobie
myobie force-pushed the fix/peer-lock-head-of-line branch from dcbf4bf to 904b2e7 Compare September 5, 2026 06:04
@myobie
myobie merged commit 5dbe595 into main Sep 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant